import os
# ros发行版本
ros_distro=os.getenv("ROS_DISTRO")
print('env ros',ros_distro)

env = Environment()
ros_include = ' -I /opt/ros/%s/include/'%(ros_distro)
ros_libdir = '/opt/ros/%s/lib'%(ros_distro)
ros_lib_dep = ['roscpp','rosconsole']


#编译选项
env['CCFLAGS'] = '-g3 -O0 -Wall '+ros_include

# 链接选项
env['LIBPATH'] = ros_libdir
env['LIBS'] = ros_lib_dep
env['RPATH'] = ros_libdir
env['LINKFLAGS'] = '-Wl,--copy-dt-needed-entries'

env.Program('test_uint8_array.out', 'test_uint8_array.cc')
env.Program('1_pub发布_在类里面.out','1_pub发布_在类里面.cc')
env.Program('2_sub订阅_在类里面.out', '2_sub订阅_在类里面.cc')
env.Program('3_sub订阅成员_和callback函数_在类里面.out', '3_sub订阅成员_和callback函数_在类里面.cc')
env.Program('11_pub_UInt8MultiArray数组_发布.out', '11_pub_UInt8MultiArray数组_发布.cc')
env.Program('12_sub_UInt8MultiArray数组_订阅.out', '12_sub_UInt8MultiArray数组_订阅.cc')